#!/bin/sh
mysql -h 10.8.0.14 -u gps -pgps -D gps -e "create table if not exists gps.gpstty (epoch bigint,mac bigint,uid integer,vendor varchar(20),serial varchar(40),path varchar(30), index(epoch,uid));"
mysql -h 10.8.0.14 -u gps -pgps -D gps -e "create table if not exists gps.gpsrmc (epoch bigint,mac bigint,uid integer,system char(1),fix integer,breite bigint,laenge bigint,velocity integer,course integer, utc bigint, index(uid,epoch,breite,laenge));"
mysql -h 10.8.0.14 -u gps -pgps -D gps -e "create table if not exists gps.gpsgsv (epoch bigint,mac bigint,uid integer,system char(1),prn smallint,elevation tinyint,azimuth smallint,snr tinyint, index(uid,epoch,prn));"
mysql -h 10.8.0.14 -u gps -pgps -D gps -e "create table if not exists gps.gpsgga (epoch bigint,mac bigint,uid integer,system char(1),fix integer,sats tinyint,hdop integer,hoehe bigint,geoid integer, index(uid,epoch,hoehe));"
mysql -h 10.8.0.14 -u gps -pgps -D gps -e "create table if not exists gps.gpsgsa (epoch bigint,mac bigint,uid integer,system char(1),pdop integer,hdop integer,vdop integer, index(uid,epoch,hdop,vdop,pdop));"
mysql -h 10.8.0.14 -u gps -pgps -D gps -e "create table if not exists gps.gpsgst (epoch bigint,mac bigint,uid integer,system char(1),rms bigint,errmaj integer,errmin integer,error integer,sig_lat integer,sig_lon integer,sig_height integer, index(uid,epoch,sig_lat,sig_lon,sig_height));"

#mysql -u gps -pgps -D gps -e "create table if not exists gps.gpsin (uid integer, id bigint, epoch bigint, telegram char(5),payload varchar(160),raw tinyint, index (uid,id,epoch,telegram,raw));"
#mysql -u gps -pgps -D gps -e "create table if not exists gps.gpsrmc (uid integer, id bigint, epoch bigint, breite bigint,laenge bigint,velocity integer,fix char(1),system char(1),fix_epoch integer,raw tinyint, index (uid,id,epoch,breite,laenge));"
#mysql -u gps -pgps -D gps -e "create table if not exists gps.gpsgga (uid integer, id bigint, epoch bigint, breite bigint,laenge bigint,fix integer,fix_epoch integer,sats tinyint,hdop decimal(3,3),hoehe integer,hoehe_datum integer,raw tinyint, index (uid,id,epoch,breite,laenge));"
#mysql -u gps -pgps -D gps -e "create table if not exists gps.gpsgsv (uid integer, id bigint, epoch bigint, prn smallint unsigned,elevation smallint unsigned,azimuth smallint unsigned,snr smallint unsigned,folge tinyint unsigned,system char(1),raw tinyint, index (uid,id,epoch,prn,system));"
#mysql -u gps -pgps -D gps -e "create table if not exists gps.gpsgsa (uid integer, id bigint, epoch bigint, system char(1),hdop decimal(5,3),vdop decimal(5,3),pdop decimal(5,3),sats varchar(50),raw tinyint, index (uid,id,epoch));"
#mysql -u gps -pgps -D gps -e "create table if not exists gps.gpsgbs (uid integer, id bigint, epoch bigint, system char(1),lat_err decimal(5,3),lon_err decimal(5,3),alt_err decimal(5,3),raw tinyint, index (uid,id,epoch));"
#mysql -u gps -pgps -D gps -e "create table if not exists gps.gpsgrs (uid integer, id bigint, epoch bigint, system char(1),fix integer,fgga integer,s1 numeric,s2 numeric,s3 numeric,s4 numeric,s5 numeric,s6 numeric,s7 numeric,s8 numeric,s9 numeric,s10 numeric,s11 numeric,s12 numeric,raw tinyint, index (uid,id,epoch));"
#mysql -u gps -pgps -D gps -e "create table if not exists gps.gpsgst (uid integer, id bigint, epoch bigint, system char(1),rms mediumint,lat_sigma decimal(5,3),lon_sigma decimal(5,3),height_sigma decimal(5,3),raw tinyint, index (uid,id,epoch));"
#mysql -u gps -pgps -D gps -e "create table if not exists gps.gpsvtg (uid integer, id bigint, epoch bigint, system char(1),course_true mediumint,course_mag mediumint,speed_kn integer unsigned,speed_kmh integer unsigned,raw tinyint, index (uid,id,epoch));"
#mysql -u gps -pgps -D gps -e "create table if not exists gps.gpsgns (uid integer, id bigint, epoch bigint, breite bigint,laenge bigint,fix integer,sats tinyint,hdop decimal(3,3),hoehe integer,hoehe_datum integer,mode varchar(8),raw tinyint, index (uid,id,epoch,breite,laenge));"
